import {lazy} from "react" // 路由懒加载
import {Navigate} from "react-router-dom" // 重定向
let Login = lazy(()=>import("../pages/login"))
let Navigation1 = lazy(()=>import("../pages/Navigation1"))
let Navigation2 =lazy(()=>import("../pages/Navigation2"))
let Navigation3 = lazy(()=>import("../pages/Navigation3"))
let Home = lazy(()=>import("../pages/home"))
let routerconfig = [
    {
        path:"/login",
        element:<Login></Login>
    },
    {
        path:"/home",
        element:<Home></Home>,
        children:[
            {
                path:"/home/navigation1",
                element:<Navigation1></Navigation1>
            },
            {
                path:"/home/navigation2",
                element:<Navigation2></Navigation2>
            },
            {
                path:"/home/navigation3",
                element:<Navigation3></Navigation3>
            },
            // {
            //     path:"/home",
            //     element:<Navigate to="/home/navigation1"></Navigate>
            // }
        ]
    },
    {
        path:"/",
        element:<Navigate to="/login"></Navigate>
    }

]
export default routerconfig